$(function(){
	function t1(){
		var t1=new Date(2017,5,13,10,0);
		return t1;
	}
	function t2(){
		var t2=new Date(2017,6,13,10,0);
		return t2;
	}
	// var ti=new Date(2017,5,13,10,0);
	// var tt=new Date(2017,4,20,10,0);
	countDown(t1(),".wd");
	countDown(t2(),".vip_list")
	// countDown(t2(),".wd")	
	function countDown(x,y){
		var t;
		timer();
		t=setInterval(timer,1000);
		function timer(){
			var ts=(x)-(new Date());//设置目标时间
			var dd=parseInt(ts/1000/60/60/24,10);
			var hh=parseInt(ts/1000/60/60%24,10);
			var mm=parseInt(ts/1000/60%60,10);
			var ss=parseInt((ts/1000)%60,10);			
			if(dd<=0&&hh<=0&&mm<=0&&ss<=0){
				clearInterval(t)
				/*$(".m-d").html("0");
				$('.m-h').html("0");
				$('.m-m').html("0");
				$('.m-s').html("0");*/
				$(y+".count_down").html('<h3 class="h_end">活动结束</h3>')
			}else{
				dd=checkTime(dd);
				hh=checkTime(hh);
				mm=checkTime(mm);
				ss=checkTime(ss);
				$(y+" .m-d").html(dd);
				$(y+' .m-h').html(hh);
				$(y+' .m-m').html(mm);
				$(y+' .m-s').html(ss);
			}			
		}
		function checkTime(i){
			if(i<10){
				i="0"+i;
			}
			return i;
		}
	}
})